#include<stdio.h>
int main()
{
    int letters=0;
    int spaces=0;
    int nums=0;
    int others=0;
    char c=0;
    printf("请输入一行字符：");
    while((c=getchar()) != '\n')
    {
        if ((c>='a' && c<='z') || (c>='A' && c<='Z'))
        letters++;
        else if(c==' ')
        spaces++;
        else if(c>='0' && c<='9')
        nums++;
        else
        others++;
    }
    printf("letters=%d\nspaces=%d\nnums=%d\nothers=%d\n",letters,spaces,nums,others);

    return 0;
    
}